﻿using InstantSpine.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace InstantSpine.GUI
{
    public sealed class VBNumericIdToNameConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            if (value != null) {
                // the raw ID is 1-based (FEModelOptions.FirstVB), but
                // VertebraIDs is an C# enumeration an hence starts at 0 => "- 1"
                var vbId = (VertebraIDs)((int)value - 1);
                return vbId.ToString();
            }
            return "Invalid ID";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            throw new NotImplementedException();
        }
    }
}
